import Vue from 'vue'
import Router from 'vue-router'
import Home from 'components/Home/Home.vue' //这是首页
import newslist from 'components/news/newslist.vue' //这是新闻的列表页
import newsinfo from 'components/news/newsinfo.vue' //这是新闻的详情页
import photolist from 'components/photos/photolist.vue'//这是图片的列表页
import photoshow from 'components/photos/photoshow.vue'//这是图片的详情页
import goodslist from 'components/goods/goodslist.vue'
import goodsshow from 'components/goods/goodshow.vue'
import goodsdesc from 'components/goods/goodsdesc.vue'
import goodscomment from 'components/goods/comment.vue';
import shopcar from 'components/shopcar/shopcar.vue';

// console.log(goodslist);


//导入mint-ui使用
import 'mint-ui/lib/style.css'
//导入mui的css
import '../../static/mui/css/mui.css'
import '../../static/mui/css/icons-extra.css'



//导入 组件包
import mintUI from 'mint-ui'
//将mintUI对象加入到Vue中通过use进行绑定 
//
import vueResource from'vue-resource' 
//导入一个时间的格式工具
import moment from 'moment';
// 创建一个全局的过滤器
Vue.filter('fmtdate',function (input,datefmtstring) {
    //我们使用moment.js的日期格式化插件 :http://momentjs.cn/
    console.log(datefmtstring)
    return moment(input).format(datefmtstring);
})


Vue.use(vueResource);
Vue.use(Router);
Vue.use(mintUI);


import VuePreview from 'vue-preview'
Vue.use(VuePreview)


//导入自定义的公共的文件
import '../../static/css/normalize.css'
import '../../static/css/site.css'


export default new Router({
    linkActiveClass: 'mui-active',
    routes: [
        { path: '/', name: 'root', redirect: '/Home' },
        { path: '/Home', name: 'Home', component: Home },//首页
        { path: '/news/newslist', name: 'newslist', component: newslist },
        { path: '/news/newsinfo/:id', name: 'newsinfo', component: newsinfo },
        { path: '/photo/photolist', name: 'photolist', component: photolist },
        { path: '/photo/photoshow/:id', name: 'photoshow', component: photoshow},
        { path: '/goods/goodslist', name: 'goodslist', component: goodslist },
        { path: '/goods/goodsshow/:id', name: 'goodsshow', component: goodsshow },
         { path: '/goods/goodsdesc/:id', name: 'goodsdesc', component: goodsdesc },
         {name:'goodscomment',path:'/goods/comment/:id',component:goodscomment}, //
          { path: '/shopcar', name: 'shopcar', component: shopcar},
         // /shopcar
        // /goods/goodslist"+item.id
        // 
    ]
})
